home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / misc / math / lifemake.cpt / LifeMaker Demo.rsrc / LIF1_12533_HGlass < prev    next >
Encoding:
Text File  |  1991-07-16  |  427 b   |  16 lines

  1. RULE HGlass (center, north, south, east, west)
  2.    VAR index, new
  3. BEGIN
  4.    index := 2*(2*(2*(2*east[0] + west[0]) + south[0]) + north[0]) + center[0]
  5.    IF (index >= 1) AND (index <= 3) THEN
  6.       new := 1
  7.    ELSIF (index = 11) OR (index = 21) OR (index = 25) THEN
  8.       new := 1
  9.    ELSIF (index >= 29) AND (index <= 31) THEN
  10.       new := 1
  11.    ELSE
  12.       new := 0
  13.    END
  14.    IF center[0] THEN new := new + 2 END
  15.    RETURN new
  16. END